Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@textlint/linter-formatter

Package Overview
Dependencies
Maintainers
5
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@textlint/linter-formatter

textlint output formatter

  • 3.3.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
72K
decreased by-20.92%
Maintainers
5
Weekly downloads
 
Created
Source

@textlint/linter-formatter

textlint output formatter.

Installation

npm install @textlint/linter-formatter

Usage

See formatters/.

Currently, you can use "stylish" (defaults), "checkstyle", "compact", "jslint-xml", "json", "junit", "pretty-error", "table", "tap", and "unix".

const createFormatter = require("@textlint/linter-formatter").createFormatter;
const formatter = createFormatter({
    formatterName: "stylish"
});
const output = formatter([
    {
        filePath: "./README.md",
        messages: [
            {
                ruleId: "semi",
                line: 1,
                column: 23,
                message: "Expected a semicolon."
            }
        ]
    }
]);
console.log(output);
/*
./README.md
  1:23  warning  Expected a semicolon  semi

✖ 1 problem (0 errors, 1 warning)
*/

API

export declare type FormatterConfig = {
    color?: boolean;
    formatterName: string;
};
export declare function createFormatter(formatterConfig: FormatterConfig): (results: TextlintResult[]) => string;
export interface FormatterDetail {
    name: string;
}
export declare function getFormatterList(): FormatterDetail[];

CLI

$ textlint -f json README.md --rule no-todo | textlint-formatter -f pretty-error --stdin

Other formatter

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT

FAQs

Package last updated on 08 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc